import request from '@/utils/request'

export function getRoleList(params) {
  return request({
    url: '/permission/role',
    params
  })
}

export function deleteRole(id) {
  return request({
    url: `/permission/role/${id}`,
    method: 'DELETE'
  })
}

export function updateRole(data) {
  return request({
    url: `/permission/role/${data.id}`,
    method: 'PUT',
    data
  })
}

export function getRoleDetail(id) {
  return request({
    url: `/permission/role/${id}`
  })
}

export function addRoleList(data) {
  return request({
    url: '/permission/role',
    method: 'POST',
    data
  })
}

// export function editRole(id) {
//   return request({
//     url: `/permission/role/${id}`,
//     method: 'PUT'
//   })
// }
